@extends('admin.layout')

@section('title')栏目管理@endsection


@section('content')
    <div class="page clearfix">

        <ol class="breadcrumb breadcrumb-small">
            <li>后台首页</li>
            <li><a href="{{ url('admin/categroys') }}">栏目管理</a></li>
            <li><a href="{{ url('admin/categroys') }}">栏目列表</a></li>
        </ol>

        <div class="page-wrap">
            <div class="row">

                <div class="col-md-12">
                    <div class="panel panel-lined clearfix mb30">
                        <div class="panel-heading mb20"><i>栏目列表</i>
                            <a href="{{url('admin/categroys/create')}}" class="btn">添加栏目</a>
                        </div>
                        <table class="table table-hover">
                            <thead>
                            <th class="col-md-1">栏目名称</th>
                            <th class="col-md-1">上级栏目</th>
                            <th class="col-md-1">是否私有</th>
                            <th class="col-md-1">操作</th>
                            </thead>
                            <tbody>
                            @foreach($list as $item)
                                <tr>
                                    <td>{{ $item['_name'] }}</td>
                                    <td>{{ showPid($item['pid']) }}</td>
                                    <td>{{ showPrivate($item['private']) }}</td>
                                    <td>
                                        <form action="{{ url('admin/categroys/'.$item['id']) }}" method="post" style="display: inline;">
                                            <input name="_method" type="hidden" value="delete">
                                            <input type="hidden" name="_token" value="{{ csrf_token() }}">
                                            <div class="btn-group">
                                                <a href="{{ url('admin/categroys/'.$item['id'].'/edit') }}" class="btn btn-primary btn-xs"><i class="fa fa-search-plus"></i>编辑</a>
                                                <button type="submit" onclick="if(confirm('确认删除吗？')) return true; else return false;" class="btn btn-danger btn-xs">
                                                    <i class="fa fa-trash-o"></i>删除
                                                </button>
                                            </div>
                                        </form>
                                    </td>
                                </tr>
                            @endforeach
                            </tbody>
                        </table>
                        <div class="panel-footer clearfix">
                            <nav class="right">{{ $list->render() }}</nav>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection